#include <iostream>
#include <cstring>

using namespace std;

int main()
{
    string s , t;
    cin >> s;
    //清除末尾的\0
    getchar();
    getline(cin , t);
    s = ' ' + s + ' ';
    t = ' ' + t + ' ';
    //转换大小写
    for(int i = 0;i < s.size();i ++) s[i] = tolower(s[i]);
    for(int i = 0;i < t.size();i ++) t[i] = tolower(t[i]);

    int cnt = 0 , f = 0;
    if(t.find(s) == -1) cout << -1 << endl;
    else
    {
        f = t.find(s);
        int pos = 0;
        while(t.find(s , pos) != -1)
        {
            pos = t.find(s , pos);
            cnt ++;
            pos ++;
        }
        cout << cnt << " " << f << endl;
    }
    return 0;
}